//
//  ExitPopUpViewController.m
//  CreditHub
//
//  Created by chenglang on 2024/9/22.
//

#import "ExitPopUpViewController.h"
#import "HomeRequest.h"

@interface ExitPopUpViewController ()

@end

@implementation ExitPopUpViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.labelBank.text = self.account;
}
- (IBAction)clickOk:(id)sender {
    [self requestAccount];
   
}
- (IBAction)clickClose:(id)sender {
    [self dismissViewControllerAnimated:YES completion:^{
        
    }];
}

- (void)requestAccount{
    xhl_hudLoading();
    __weak typeof(self) weakSelf = self;
    [HomeRequest requestPersonalLogoutSuccess:^(NSURLSessionDataTask *task, id response) {
        if([response[@"ofexcitement"] integerValue] == 0){
            [weakSelf dismissViewControllerAnimated:YES completion:^{
                if(weakSelf.okBlock){
                    weakSelf.okBlock();
                }
            }];
        }
        xhl_showMessage(response[@"shared"]);
        
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        xhl_hudLoading();
    }];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
